package com.gitee.mars.tourserver.controller;

import com.gitee.mars.tourserver.request.AdminOperateLogReq;
import com.gitee.mars.tourserver.response.result.R;
import com.gitee.mars.tourserver.service.IAdminOperateLogService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * AdminOperateLog 控制层
 *
 * @Author wq
 * @Date 2021-02-03
 **/
@RestController
@RequestMapping("admin/operateLog")
@AllArgsConstructor
public class AdminOperateLogController {

    private final IAdminOperateLogService adminOperateLogService;

    /**
     * 保存操作日志
     *
     * @param req adminOperateLog
     */
    @PostMapping("/add")
    public R add(@RequestBody AdminOperateLogReq req) {
        adminOperateLogService.add(req);
        return R.success("新增成功");
    }

    /**
     * 列表
     *
     * @return R
     */
    @PostMapping("/page")
    public R list(@RequestBody AdminOperateLogReq req) {
        return R.success(adminOperateLogService.pageList(req));
    }

}